<?php

namespace App\Models\Orm;
use Illuminate\Database\Eloquent\Model;

class Pay extends Model
{
    const TABLE_NAME = 'pay';
    const PRIMARY_KEY = 'id';

    protected $table = self::TABLE_NAME;
    //主键id
    protected $primaryKey = self::PRIMARY_KEY;
    //查询字段
    protected $visible = [];
    //加黑名单
    protected $guarded = [];
    // 上线状态
    const STATUS_OFF = 0;           // 下线
    const STATUS_ON = 1;            // 上线

    //哪种支付方式
    const WEIXIN = 1;
    const ZHIFUBAO = 2;
    const BANK = 3;
    const WALLET = 4;


    public static $status_text = [
        self::STATUS_OFF => '下线',
        self::STATUS_ON => '上线',
    ];


    public static $type_text = [
        self::WEIXIN => '微信',
        self::ZHIFUBAO => '支付宝',
        self::BANK => '银行卡',
        self::WALLET => '钱包地址',

    ];
    /**
     * 上线状态
     * @return mixed|string
     */
    public static function getStatusText($status)
    {
        return isset(self::$status_text[$status]) ? self::$status_text[$status] : '未知';
    }

    /**
     *支付类型
     * @return mixed|string
     */
    public static function getTypeText($status)
    {
        return isset(self::$type_text[$status]) ? self::$type_text[$status] : '未知';
    }


}